import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import { registerMicroApps, start } from "qiankun";
Vue.config.productionTip = false;

registerMicroApps(
  [
    {
      name: "vueapp1", // 应用名
      entry: "//localhost:8031", // 应用地址
      container: "#container", // 要显示的容器名 就是<div id="container"></div>
      activeRule: "/mypage1", // 跳转的顶部url
    },
    // {
    //   name: "vueapp2",
    //   entry: "//localhost:8032",
    //   container: "#container",
    //   activeRule: "/mypage2",
    // },
  ],
  {
    beforeLoad: (app) => console.log(`主应用里，子应用 ${app.name} 第一次加载触发 before load `), // 第一次加载触发
    beforeMount: [(app) => console.log(`主应用里，子应用 ${app.name} 挂载触发 before mount `)] // 挂载触发,
  }
);

start();
new Vue({
  render: (h) => h(App),
  router,
}).$mount("#app");
